import request from '@/utils/request'


// 获取通知数据
export function listNotice(page,pageSize) {
  const params = {
    page,
    pageSize
  }
  return request({
    url: '/admin/mp/notice/page',
    method: "GET",
    params,
  })
}

// 添加通知
export function addNotice(title,content) {
  const noticeForm = {
    title,
    content,
  } 
  return request({
    url: "/admin/mp/notice",
    method: "POST",
    data: noticeForm
  })

} 

// 修改通知
export function updateNotice(id,title,content) {
  const noticeForm = {
    id,
    title,
    content
  }
  return request({
    url: "/admin/mp/notice",
    method: "PUT",
    data: noticeForm
  })
}

// 根据ID删除通知
export function deleteNotice(noticeId) {
  return request({
    url: "/admin/mp/notice",
    method: "DELETE",
    params: { 
      id: noticeId 
    }
  })
}